using System;
using System.ComponentModel.DataAnnotations;

namespace CR.Application.DTOs
{
    /// <summary>
    /// 溯源管理更新数据传输对象
    /// </summary>
    public class TraceabilityUpdateDTO
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        [Required(ErrorMessage = "ID不能为空")]
        public int Id { get; set; }

        /// <summary>
        /// 溯源管理编号
        /// </summary>
        [Required(ErrorMessage = "溯源码不能为空")]
        [StringLength(50, ErrorMessage = "溯源码长度不能超过50个字符")]
        public string TraceabilityCode { get; set; }

        /// <summary>
        /// 商品名称
        /// </summary>
        [Required(ErrorMessage = "商品名称不能为空")]
        [StringLength(100, ErrorMessage = "商品名称长度不能超过100个字符")]
        public string ProductName { get; set; }

        /// <summary>
        /// 生产批次
        /// </summary>
        [Required(ErrorMessage = "生产批次不能为空")]
        public DateTime ProductionBatch { get; set; }

        /// <summary>
        /// 保质期(天)
        /// </summary>
        [Required(ErrorMessage = "保质期不能为空")]
        [Range(1, 3650, ErrorMessage = "保质期应在1-3650天之间")]
        public int ShelfLife { get; set; }

        /// <summary>
        /// 生产许可证号
        /// </summary>
        [Required(ErrorMessage = "生产许可证号不能为空")]
        [StringLength(50, ErrorMessage = "生产许可证号长度不能超过50个字符")]
        public string ProductionLicenseNumber { get; set; }

        /// <summary>
        /// 生产企业
        /// </summary>
        [Required(ErrorMessage = "生产企业不能为空")]
        [StringLength(100, ErrorMessage = "生产企业名称长度不能超过100个字符")]
        public string ProductionCompany { get; set; }

        /// <summary>
        /// 封面图
        /// </summary>
        [StringLength(255, ErrorMessage = "封面图URL长度不能超过255个字符")]
        public string CoverImage { get; set; }

        /// <summary>
        /// 生产日期
        /// </summary>
        public DateTime? ProductionDate { get; set; }
    }
} 